import Vue from 'vue'
import VueRouter from 'vue-router'

// Vue.use(VueRouter)

const routes = [
  //移动端
  {
    path: '/',
    name: 'index',
    component: () => import('../views/Index')
  },
  {
    path: '/type',
    name: 'type',
    component: () => import('../views/Type')
  },
  {
    path: '/tag',
    name: 'tag',
    component: () => import('../views/Tags')
  },
  {
    path: '/links',
    name: 'Link',
    component: () => import('../views/Links')
  },
  {
    path: '/message',
    name: 'message',
    component: () => import('../views/Message')
  },
  {
    path: '/author',
    name: 'author',
    component: () => import('../views/Author')
  },
  {
    path: '/search',
    name: 'search',
    component: () => import('../views/Search')
  },
  {
    path: '/blog/:id',
    name: 'blog',
    props: true,
    component: () => import('../components/move/Blog')
  },
]

const router = new VueRouter({
  // base: process.env.BASE_URL,
  // mode:'history', //去掉#号
  mode: 'hash',
  routes
})

const VueRouterPush = VueRouter.prototype.push
VueRouter.prototype.push = function push (to) {
  return VueRouterPush.call(this, to).catch(err => err)
}

export default router